﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Integrator.DAL.MESSAGE
{
    public class TideInterestRateEnquiryResponse : BaseResponse
    {
        /// Thong tin chi tiet cac truong bi lap
        /// </summary>
        public List<TideInterestRateEnquiryResDetail> TideInterestRateEnquiryResDetail;             

        protected override void FromStringToDetail(string message)
        {
            if (TideInterestRateEnquiryResDetail == null)
            {
                TideInterestRateEnquiryResDetail = new List<TideInterestRateEnquiryResDetail>();
            }

            TideInterestRateEnquiryResDetail detail = new TideInterestRateEnquiryResDetail();
            detail.FromString(message);
            TideInterestRateEnquiryResDetail.Add(detail);
        }

        protected override void SaveDetail(long parentId)
        {
            foreach (TideInterestRateEnquiryResDetail detail in TideInterestRateEnquiryResDetail)
            {
                detail.Save(parentId);
            }
        }

        protected override bool IsDetailProperty(string propertyName)
        {
            return new TideInterestRateEnquiryResDetail().IsPropertyOf(propertyName);
        }

        public override string ToString()
        {
            string result = base.ToString();
            foreach (TideInterestRateEnquiryResDetail detail in TideInterestRateEnquiryResDetail)
            {
                result += detail.ToString();
            }
            return result;
        }
    }
}
